package com.ssy.lingxi.settle.accounts.entity;

import javax.persistence.*;
import java.io.Serializable;

/**
 * 会员收据发票DO
 * @author 伍将
 * @date 2020/10/26
 * @version 2.0.0
 */
@Entity
@Table(schema = "public", name = "sa_member_receipt_invoice", indexes = {
        // 生成唯一索引，后续报表统计数据需要使用
        @Index(name = "sa_member_receipt_invoice_update_x", columnList = "memberId,roleId,orderNo,settlementOrderType,orderType,dataId,isHasTax,taxRate", unique = true),
        @Index(name = "sa_member_receipt_invoice_member_idx", columnList = "memberId,roleId"),
        @Index(name = "sa_member_receipt_invoice_order_time_idx", columnList = "orderTime"),
        @Index(name = "sa_member_receipt_invoice_pay_time_idx", columnList = "payTime"),
        @Index(name = "sa_member_receipt_invoice_invoice_status_idx", columnList = "invoiceStatus"),
        @Index(name = "sa_member_receipt_invoice_pay_status_idx", columnList = "payStatus")})
public class MemberReceiptInvoiceDO implements Serializable {
    private static final long serialVersionUID = -1590204680644238741L;

    /**
     * ID
     */
    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "member_receipt_invoice_seq")
    @SequenceGenerator(sequenceName = "sa_member_receipt_invoice_seq", name = "member_receipt_invoice_seq", allocationSize = 1)
    private Long id;

    /**
     * 会员id
     */
    @Column(columnDefinition = "int8")
    private Long memberId;

    /**
     * 角色id
     */
    @Column(columnDefinition = "int8")
    private Long roleId;

    /**
     * 支付会员id
     */
    @Column(columnDefinition = "int8 default 0")
    private Long payMemberId;

    /**
     * 支付角色id
     */
    @Column(columnDefinition = "int8 default 0")
    private Long payRoleId;

    /**
     * 单据号
     */
    @Column(columnDefinition = "varchar(50)")
    private String orderNo;

    /**
     * 单据摘要
     */
    @Column(columnDefinition = "varchar(50)")
    private String orderAbstract;

    /**
     * 单据类型:1.生成通知单 2.物流单 3.订单 4.积分订单 5.退货申请单 6.请款单
     * SettlementOrderTypeEnum
     */
    @Column(columnDefinition = "int")
    private Integer settlementOrderType;

    /**
     * 订单类型:ReceiptInvoiceOrderTypeEnum
     */
    @Column(columnDefinition = "int")
    private Integer orderType;

    /**
     * 单据时间
     */
    @Column(columnDefinition = "int8")
    private Long orderTime;

    /**
     * 单据总额
     */
    @Column(columnDefinition = "decimal")
    private Double orderAmount;

    /**
     * 批次
     */
    @Column(columnDefinition = "int")
    private Integer batch;

    /**
     * 支付环节
     */
    @Column(columnDefinition = "varchar(50)")
    private String payNode;

    /**
     * 支付金额
     */
    @Column(columnDefinition = "decimal")
    private Double payAmount;

    /**
     * 支付时间
     */
    @Column(columnDefinition = "int8")
    private Long payTime;

    /**
     * 开票状态
     * ReceiptInvoiceStatusEnum
     */
    @Column(columnDefinition = "int")
    private Integer invoiceStatus;

    /**
     * 支付状态
     * ReceiptInvoicePayStatusEnum
     */
    @Column(columnDefinition = "int")
    private Integer payStatus;

    /**
     * 关联数据id
     */
    @Column(columnDefinition = "int8 default 0")
    private Long dataId;


    /**
     * 是否含税：CommonBooleanEnum
     */
    @Column(columnDefinition = "int")
    private Integer isHasTax;

    /**
     * 税率
     */
    @Column(columnDefinition = "decimal")
    private Double taxRate;

    public Integer getIsHasTax() {
        return isHasTax;
    }

    public void setIsHasTax(Integer isHasTax) {
        this.isHasTax = isHasTax;
    }

    public Double getTaxRate() {
        return taxRate;
    }

    public void setTaxRate(Double taxRate) {
        this.taxRate = taxRate;
    }

    public Long getPayMemberId() {
        return payMemberId;
    }

    public void setPayMemberId(Long payMemberId) {
        this.payMemberId = payMemberId;
    }

    public Long getPayRoleId() {
        return payRoleId;
    }

    public void setPayRoleId(Long payRoleId) {
        this.payRoleId = payRoleId;
    }

    public Long getDataId() {
        return dataId;
    }

    public void setDataId(Long dataId) {
        this.dataId = dataId;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getMemberId() {
        return memberId;
    }

    public void setMemberId(Long memberId) {
        this.memberId = memberId;
    }

    public Long getRoleId() {
        return roleId;
    }

    public void setRoleId(Long roleId) {
        this.roleId = roleId;
    }

    public Integer getSettlementOrderType() {
        return settlementOrderType;
    }

    public void setSettlementOrderType(Integer settlementOrderType) {
        this.settlementOrderType = settlementOrderType;
    }

    public Integer getOrderType() {
        return orderType;
    }

    public void setOrderType(Integer orderType) {
        this.orderType = orderType;
    }

    public Long getOrderTime() {
        return orderTime;
    }

    public void setOrderTime(Long orderTime) {
        this.orderTime = orderTime;
    }

    public Double getOrderAmount() {
        return orderAmount;
    }

    public void setOrderAmount(Double orderAmount) {
        this.orderAmount = orderAmount;
    }

    public Integer getBatch() {
        return batch;
    }

    public void setBatch(Integer batch) {
        this.batch = batch;
    }

    public String getPayNode() {
        return payNode;
    }

    public void setPayNode(String payNode) {
        this.payNode = payNode;
    }

    public Double getPayAmount() {
        return payAmount;
    }

    public void setPayAmount(Double payAmount) {
        this.payAmount = payAmount;
    }

    public Long getPayTime() {
        return payTime;
    }

    public void setPayTime(Long payTime) {
        this.payTime = payTime;
    }

    public Integer getInvoiceStatus() {
        return invoiceStatus;
    }

    public void setInvoiceStatus(Integer invoiceStatus) {
        this.invoiceStatus = invoiceStatus;
    }

    public Integer getPayStatus() {
        return payStatus;
    }

    public void setPayStatus(Integer payStatus) {
        this.payStatus = payStatus;
    }

    public String getOrderNo() {
        return orderNo;
    }

    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }

    public String getOrderAbstract() {
        return orderAbstract;
    }

    public void setOrderAbstract(String orderAbstract) {
        this.orderAbstract = orderAbstract;
    }
}
